<template>
  <div class="con">
    <div class="height_50"></div>
    <MessageHeader
      :index="index"
      :headerlist="headerlist"
      class="messageheader"
    />
    <router-view />
    <Tabbar
      @changeTabbar="changeTabbar"
      :index="index"
      :tabbarlist="tabbarlist"
      class="tabbar"
    />
    <div class="height_50"></div>
  </div>
</template>

<script>
import Tabbar from "@/components/message/Tabbar";
import MessageHeader from "@/components/message/MessageHeader";


export default {
  data() {
    return {
      index: 0,
      headerlist: [
        {
          title: "消息",
          id: 0,
          icon: "icon-jia",
        },
        {
          title: "联系人",
          id: 0,
          icon: "icon-useradd",
        },
        {
          title: "个人中心",
          id: 0,
          icon: "icon-system",
        },
      ],
      tabbarlist: [
        {
          title: "消息",
          id: 0,
          icon: "icon-xiaoxi",
        },
        {
          title: "联系人",
          id: 1,
          icon: "icon-lianxirenguanli",
        },
        {
          title: "我的",
          id: 2,
          icon: "icon-mine",
        },
      ],
    };
  },
  components: {
    Tabbar,
    MessageHeader,
  },

  methods: {
  
    changeTabbar(id) {
      if (id != this.index) {
        this.index = id;
      }
    },
  },
};
</script>

<style lang="less" scoped>
.con {
  height: 100vh;
  width: 100vw;
}

.tabbar {
  background-color: #f1f1f1;
  position: fixed;
  bottom: 0;
  left: 0;
  height: 0.5rem;
  width: 100vw;
  z-index: 999;
}

.messageheader {
  background-color: #f1f1f1;
  position: fixed;
  top: 0;
  left: 0;
  height: 0.5rem;
  width: 100vw;
  z-index: 999;
}
.height_50 {
  height: 50px;
}
</style>